<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>今天星期几</title>
	</head>
	<body>
		<h2 id="day"></h2>
		<script>
			//从Date 对象返回一周中的某一天（0~6）
			var date=new Date().getDay();
			var h2=document.getElementById('day');
			
			var s="今天星期几";
			switch(date){
				case 0:
				s +="天";
				break;
				 case 1:
				  s +="一";
				  break;
				  case 2:
				   s +="二";
				    break;
				     case 3:
				      s += "三";
				       break;
				        case 4:
				         s += "四";
				           break;
				            case 5:
				         s += "五";
				           break;
				           case 6:
				         s += "六";
				           break;
				            default:
				             break;
				            
			}
			h2.innerText=date;
			/*if(date==0){
				h2.innerText=7;
				
			}else{
				h2.innerText=date;
			}*/
		</script>
	</body>
</html>
